package com.cari.oa.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cari.oa.dao.BaseDao;
import com.cari.oa.dao.NotificationDao;
import com.cari.oa.domain.NotificationEntity;

@Service
@Transactional(rollbackFor = Exception.class)
public class NotificationService extends BaseService<NotificationEntity>{

	@Resource
	private NotificationDao notificationDao;

	@Override
	public BaseDao<NotificationEntity> getDao() {
		return notificationDao;
	}
	public Long getListByToUser(String toUser)
	{
		return notificationDao.getListByToUser(toUser);
	}
	
	/**
	 * 分页查询信息
	*@param toUser
	*@param isRead
	*@param page
	*@param size
	*@return
	*@author hjx
	*@date 2013-5-8下午3:39:38
	 */
    public List<NotificationEntity> getPage(String toUser, int isRead,String title, int page, int size) {
    	return notificationDao.getPage(toUser, isRead, title, page, size);
    }
    
    /**
     * 获取满足条件的记录数
    *@param toUser
    *@param isRead
    *@return
    *@author hjx
    *@date 2013-5-8下午3:40:03
     */
    public long getCount(String toUser, int isRead, String title)
    {
    	return notificationDao.getCount(toUser, isRead, title);
    }
}
